/*
 * @Author: C.
 * @Date: 2024-04-15 15:38:50
 */
import { Toast, NavBar, Button, PullRefresh, List, Tabs, SwipeCell, Cell, Tag } from 'react-vant';
import { useNavigate } from 'react-router-dom';
import { Checked } from '@react-vant/icons';
import { datas } from '../../mock/data';
export default () => {
  const navigate = useNavigate();
  function goBack() {
    navigate(-1);
  }
  const [list, setList] = useState<Recordable[]>([]);
  const [finished, setFinished] = useState<boolean>(false);

  const onLoad = async () => {
    setList(datas);
    setFinished(true);
  };
  return (
    <>
      <NavBar fixed title="翻译本" leftText="返回" onClickLeft={() => goBack()} />
      <List finished={finished} onLoad={onLoad}>
        {list.map((item, idx) => (
          <SwipeCell
            key={idx}
            rightAction={
              <Button style={{ height: '100%' }} square type="danger">
                删除
              </Button>
            }
          >
            <Cell
              title={idx + 1 + '. ' + item.cnContent}
              value={<Checked color="#6d28d9" fontSize={22} style={{ display: 'inline' }} />}
            ></Cell>
          </SwipeCell>
        ))}
      </List>
    </>
  );
};
